import { Component, OnInit, Input } from '@angular/core';
import { UserService } from 'src/app/service/user.service';
import { YearawardService } from '../yearaward.service';
import { BaseService } from 'src/app/service/base.service';
import { UtilsService } from 'src/app/service/utils.service';
import { Router, Route } from '@angular/router';
import type { Subject } from 'rxjs';
@Component({
  selector: 'app-renqi',
  templateUrl: './renqi.component.html',
  styleUrls: ['./renqi.component.scss'],
})
export class RenqiComponent implements OnInit {
  @Input() timeConfig: any[] = [];
  // @Input() taskDialogSub: Subject<EndYear.Renqi.ITaskItem>;
  /* ___ _ ___ */
  public stageId: number;
  public deployUrl: string; /* 资源地址前缀 */
  /* ___ _ ___ */
  public isPC = false; /* 是否pc */
  public isAndroid = false; /* 是否安卓 */
  public onRefrash = false; /* 刷新中 */
  public tabs: number[] = [1, 2, 3]; /* tabs */
  /* ___ _ ___ */
  public curTab = 1; /* 当前tab 1总榜 2周榜 3每日任务 */

  constructor(
    private userService: UserService,
    private yearawardService: YearawardService,
    private baseService: BaseService,
    private utilsservice: UtilsService,
    private router: Router
  ) {}

  ngOnInit(): void {
    // 获取
    this.deployUrl = this.userService.getDeployUrl();
    this.isPC = this.userService.getIsPc();
    this.isAndroid = this.utilsservice.getBrowserVersion();
  }
  /**
   * @param tab 当前tab
   * @description: 切换tab
   */
  onTabClick(tab) {
    this.curTab = tab;
  }
}
